<!DOCTYPE html>
<html lang="ch">
    <head>
        <meta charset="UTF-8">
        <title>switch语法</title>

        <script>
            var a;

            switch (a){
                case 1:
                    alert("number");
                    break;
                case "aa":
                    alert("string");
                    break;
                case true:
                    alert("true");
                    break;
                case null:
                    alert("null");
                    break;
                case undefined:
                    alert("undefined");
                    break;
            }
        </script>
    </head>

    <body>

    </body>
</html>